package cn.edu.cqupt.cxcy.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;

import cn.edu.cqupt.cxcy.dao.AdminDao;
import cn.edu.cqupt.cxcy.dao.IndexDao;
import cn.edu.cqupt.cxcy.dto.AdminImpl;
import cn.edu.cqupt.cxcy.dto.IndexImpl;
import cn.edu.cqupt.cxcy.mail.Email;
import cn.edu.cqupt.cxcy.model.Field;
import cn.edu.cqupt.cxcy.model.Notice;

/**
 * 此为测试类，限于java小程序
 * @author Dancer-mno
 * @date 2015年10月10日
 */
public class Test {

	
	public static void main(String[] args) {

		System.out.println(Math.ceil(4.0/5)); // F59BD65F7EDAFB087A81D4DCA06C4910
		System.out.println(Tools.getMD5(Tools.getMD5("123456")));
		Notice fnew = new IndexImpl().getNewNoticeHaveImg();
		System.out.println(Tools.Html2Text(fnew.getN_content(), 145));
//		JsonUtil json = new JsonUtil();
//		Calendar rightNow = Calendar.getInstance();
//		rightNow.setTime(new Date());
//        rightNow.add( Calendar.DAY_OF_YEAR, -8);//日期加10天
//        AdminDao admin = new AdminImpl();
//        Date dt1=rightNow.getTime();
//        List<Object> lists = admin.caleList(dt1, 255);
//		json.put("paging", lists);
//		for(int i=0,j=lists.size(); i<j; i++) {
//			System.out.println(((Field)((List<Object>)lists.get(i)).get(0)).getF_startime());
//		}
//		System.out.println(json.toString());
//		SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMdd");
//        String str="20110823";
//        Date dt = null;
//		try {
//			dt = sdf.parse(str);
//		} catch (ParseException e) {
//			e.printStackTrace();
//		}
//        Calendar rightNow = Calendar.getInstance();
//        rightNow.setTime(new Date());
        //rightNow.add(Calendar.YEAR,-1);//日期减1年
        //rightNow.add(Calendar.MONTH,3);//日期加3个月

//		System.out.println(Tools.getDateyyyyMMdd());
//		String fileName = "01:20:30";
//		fileName=fileName.substring( 0,fileName.lastIndexOf(":"));
//		String ss = fileName.substring( 0,2);
//		int dd = Integer.parseInt(ss);
//		System.out.println(fileName + "," + ss + "," + dd);
//		String s = "01:23:00";
//		System.out.println(Tools.getTimeddHHmm(s).toString());
//        String s = fileName.substring(fileName.length()-4,fileName.length());
//        System.out.println(fileName + "," + s);
		//设置需要的时间 
		//c.set(Calendar.YEAR, 2009); 
		//第二个参数是设置月的，月是基于0的 
		         //arg list:year,month,day,hour,minute,second 
//		Email.sendCode("ss", "574819887@qq.com");
//		System.out.println(new Date);

//		SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//可以方便地修改日期格式
//		String hehe = dateFormat.format( new Date()); 
//		String haha = new String("2014-09-02 11:22:22");
//		System.out.println(hehe); 
//		
//		if(Long.valueOf(hehe.replaceAll("[-\\s:]",""))<Long.valueOf(haha.replaceAll("[-\\s:]", ""))) {
//			System.out.println("ss");
//		}
//		for(Object list:new IndexImpl().getCountNess()) {
//			System.out.println(list);
//		}
//		String ii = Integer.toString(i);
//		String ww = "";
//		for(int q=0; q<ii.length(); q++) {
//			if(q == ii.length()-1) {
//				ww += ii.charAt(q);
//			} else {
//				ww += ii.charAt(q) + " ";
//			}
//		}
//		System.out.println(13/3);
	}

}
